//具体封装请求的方法
import request from './axios'
const key = 'b892d33b2708fe24bf6af37ae39e07a7'
const IP = '120.239.16.116'
const extent = 'extensions=all'
// 获得IP所在地区
export const getLocation = () => {
  return request.get('/ip?key=' + key + '&ip=' + IP)
}
// 获得当日天气
//参数:adcode
export const getWeather = (adcode) => {
  return request.get('/weather/weatherInfo?key=' + key + '&city=' + adcode)
}
export const getAllWeather = (adcode) => {
  return request.get('/weather/weatherInfo?key=' + key + '&city=' + adcode + '&' + extent)
}
// 根据名称获得地区
//参数:address
export const getCity = (address) => {
  return request.get('/geocode/geo?key=' + key + '&address=' + address)
}
